package KTP;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;

public class Lx03 {
    public static void main(String[] args) {
        String pathname = "D:\\docum\\java"+ File.separator;
        File file = new File(pathname+"number.txt");
        try {
            file.createNewFile();
            RandomAccessFile randomAccessFile = new RandomAccessFile(file,"rw");
            for (int i = 1 ; i < 100; i++) {
                if(i % 3 == 0 || i % 5 == 0) {
                    randomAccessFile.writeBytes(String.valueOf(i)+"  ");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
